﻿//
// Copyright (c) 2019-2023 BPer
//
#ifndef BPERAUDIODEVICEMAC_H
#define BPERAUDIODEVICEMAC_H
#include <bperutil/BPerType.h>
#if BPer_OS_APPLE

//#include <CoreFoundation/CFString.h>
//#include <AudioUnit/AudioUnit.h>
#include <CoreAudio/CoreAudio.h>
#include <bperutil/sys/BPerLog.h>




#define bPer_release(x) if(x){CFRelease(x);x=NULL;}
#define bPer_success(a,b) if(a!=noErr){bPer_error("%s(%d)",b,(int)a);return 1;}


int32_t bPer_mac_audio_getDefaultDevice(AudioDeviceID* pids,bool isInput);
int32_t bPer_mac_audio_init(bool isInput,AudioDeviceID deviceId,uint32_t *sample,uint32_t channel);
void bPer_mac_audio_uninit(bool isInput,AudioDeviceID deviceId);
#endif
#endif // BPERAUDIODEVICEMAC_H
